<?php

namespace app\api\controller\employ;

use app\api\controller\Controller;
use app\api\model\employ\Employ as EmployModel;
use app\api\model\employ\Poster as PosterModel;

class Employ extends Controller
{
    public function poster()
    {
        $model = new PosterModel;
        $list = $model->getPublish($this->getUser());
        return $this->renderSuccess('', compact('list'));
    }

    public function sendCAPTCHA()
    {

    }


    public function submitEmploy()
    {
        $model = new EmployModel;
        if ($model->add($this->getUser(), $this->postData())) {
            return $this->renderSuccess('操作成功');
        }
        return $this->renderError($model->getError() ?: "提交失败");
    }
}